import React from 'react';

const List11 = () => {
  const list = [
    { id: 'q1', title: 'aa', isPublish: true },
    { id: 'q2', title: 'ab', isPublish: false },
    { id: 'q3', title: 'ac', isPublish: true },
    { id: 'q4', title: 'ad', isPublish: false },
  ];

  const click = (itm: any) => {
    console.log(itm, '14');
  };

  return (
    <>
      <h1>问卷列表</h1>
      <div>
        {list?.map(itm => {
          const { id, title, isPublish } = itm;
          return (
            <div key={id} className="list-dom">
              <strong>{title}</strong>
              &nbsp;
              {isPublish ? (
                <span style={{ color: 'green' }}>已发布</span>
              ) : (
                <span style={{ color: 'red' }}>未发布</span>
              )}
              &nbsp;
              <button onClick={() => click(itm)}>编辑问卷</button>
            </div>
          );
        })}
      </div>
    </>
  );
};

export default List11;
